import {  setSchemaCpm, useFieldMapToTimeHelper, useNowDpSearchHelper, useSelectSearchHelper, useWhetherSelectSearchHelper,  } from "@/utils/common"

const useForms = ()=>{
  const inputMapPatch = [];
  const selectFields = []
  const nowDpFields = []
  const whetherFields = []

  const { selectMapPatch, setSelectOpts } = useSelectSearchHelper(selectFields)
  const nowDpMapPatch = useNowDpSearchHelper(nowDpFields)
  const whetherMapPatch = useWhetherSelectSearchHelper(whetherFields)
  const fieldMapToTime = useFieldMapToTimeHelper([], 'Start', 'End')

  const cpmGetterMap = new Map<string, SchemaCpmGetter>([
    ...inputMapPatch,
    ...selectMapPatch,
    ...nowDpMapPatch,
    ...whetherMapPatch
  ]);
  const afterGetSchemas = (schemas: Recordable[]): Recordable[] => {
    return setSchemaCpm(schemas, cpmGetterMap)
  }

  const getOptions = ()=>{
    setSelectOpts({})
  }

  return {
    afterGetSchemas,
    getOptions,
    fieldMapToTime
  }

}

export default useForms